<include file="public@header"/>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row">
        <div class="layui-page-header">
            <div class="layui-card">
                <div class="layui-page-header-content">
                    <div class="layui-card-body">
                        <div class="layui-ui-page-header-title" >
                            钩子管理
                            <span class="layui-badge-rim page-content">ThinkCMF系统插件钩子管理</span>
                        </div>
                    </div>
                    <div class="layui-tab layui-tab-brief">
                        <ul class="layui-tab-title">
                            <li class="layui-this"><a>所有钩子</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-page-content">
            <div class="layui-card">
                <div class="layui-card-body">
                    <div class="layui-bg-alert layui-bg-remind">
                        <i class="icon-icon layui-icon-md-information-circle"></i>
                        <span>新增插件后需要同步钩子后再进行操作</span><a href="javascript:admin.openIframeLayer('{:url('Hook/sync')}','同步钩子',{skin: 'layer-ext',area:['300px','100px'],end:function(){location.reload();}});">点击同步</a>
                    </div>
                    <form action="" method="post" class="layui-form">
                        <php>
                            $types = ["1"=>'系统钩子','2'=>'应用钩子','3'=>'模板钩子','4'=>'后台模板钩子'];
                        </php>
                        <table class="layui-table" lay-even lay-size="lg">
                            <thead>
                            <tr>
                                <th width="50">ID</th>
                                <th>名称</th>
                                <th>类型</th>
                                <th>描述</th>
                                <th width="50">{:lang('ACTIONS')}</th>
                            </tr>
                            </thead>
                            <tbody>
                            <foreach name="hooks" item="vo">
                                <tr>
                                    <td>{$vo.id}</td>
                                    <td>{$vo.name}:{$vo.hook}</td>
                                    <td>
                                        <if condition="$vo['type']==1">
                                            <a class="layui-badge layui-bg-remind">{$types[$vo.type]}</a>
                                            <elseif condition="$vo['type']==2">
                                                <a class="layui-badge layui-bg-correct">{$types[$vo.type]}</a>
                                            <elseif condition="$vo['type']==3">
                                                <a class="layui-badge layui-bg-error">{$types[$vo.type]}</a>
                                            <else/>
                                                <a class="layui-badge layui-bg-warning">{$types[$vo.type]}</a>
                                        </if>
                                    </td>
                                    <td>{$vo.description}</td>
                                    <td>
                                        <a class="nobtn" href="javascript:admin.openIframeLayer('{:url('Hook/plugins',['hook'=>$vo['hook']])}','钩子{$vo.name}插件管理',{area:['90%','500px']});">管理</a>
                                    </td>
                                </tr>
                            </foreach>
                            </tbody>
                        </table>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<include file="public@script"/>
</body>
</html>